import type { PermissionRecord } from './Permission';
import type { RoleRecord } from './Role';

export interface UserRecord {
  id: number;
  username: string;
  nickname: string;
  avatarImage: string;
  email: string;
  password: string;
  userRoles: {
    role: RoleRecord;
  }[];
  createTime: string;
  updateTime: string;
  // 后端组装数据，start
  // 角色列表
  roles: RoleRecord[];
  // 角色权限树
  permissionTree?: PermissionTreeNode[];
  permissionList: PermissionRecord[];
  // 后端组装数据，end
}

export interface PermissionTreeNode extends PermissionRecord {
  children?: PermissionTreeNode[];
}
